You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A small (but real!) optimization would be to extract the 'typeMap' from this script and use the params option of the script processor to pass that same information to the script instead:
def type = typeMap[ctx.dns.question.Ext_temp.type];
if (type != null) {
ctx.dns.question.type = type;
}
As written, the script processor builds that map from scratch every time for every document, but if you switch to the params pattern, then the map would be constructed just once and passed into the script processor for every document.
I noticed this while processing flamegraphs to see where this pipeline was spending its time, you can see here that the vast majority of the time spent by this script processor is just in building up the map for processing, rather than actually doing the real work it's there to do:
edit: Note, however, it's still just a fraction of the time spent in any processor at all. While this change will speed up the script processor in question quite a bit, I don't want you to think it's going to improve the performance of the whole pipeline enormously (but every couple of percents count, right?).
The text was updated successfully, but these errors were encountered:
A small (but real!) optimization would be to extract the 'typeMap' from this script and use the
params
option of thescript
processor to pass that same information to the script instead:endpoint-package/package/endpoint/data_stream/network/elasticsearch/ingest_pipeline/default.yml
Lines 72 to 96 in b52f3be
As written, the script processor builds that map from scratch every time for every document, but if you switch to the params pattern, then the map would be constructed just once and passed into the script processor for every document.
/cc @pzl
I noticed this while processing flamegraphs to see where this pipeline was spending its time, you can see here that the vast majority of the time spent by this script processor is just in building up the map for processing, rather than actually doing the real work it's there to do:
edit: Note, however, it's still just a fraction of the time spent in any processor at all. While this change will speed up the
script
processor in question quite a bit, I don't want you to think it's going to improve the performance of the whole pipeline enormously (but every couple of percents count, right?).The text was updated successfully, but these errors were encountered: