Skip to main content
Known Participant
June 5, 2016
Answered

RegExp is 10x slower in Adobe Air

  • June 5, 2016
  • 1 reply
  • 964 views

This code run 10x slower in Adobe Air:

import flash.utils.getTimer;

var str:String = "I'm a short string I'm a short string I'm a short string I'm a short string I'm a short string";

var r:RegExp = /rt|tr|m|a|n/g

var t:int = getTimer();

var result:String;

for (var i:uint = 0, n:uint = 100000; i < n; ++i)

{

result = str.replace(r, '|');

}

trace(getTimer() - t);

trace(result);

I run this code in both Flash Player and Adobe Air (Release Mode, Win 10 64-Bit, Dell Inspiron 3542), and get the result:

Flash Player: 874 ms

Adobe Air: 5461 ms

I tested this code with Animate CC and Flash Develop and get the similar result. Sometimes I get 10x slower.

I has been posted this issue here: Bug#4161031 - Regular Expression (RegExp) is 10x slower in Adobe Air

It's a strange issue. Anybody that interest please do the test and report the result here?

Thanks!

This topic has been closed for replies.
Correct answer Roshan Chhetri

Hi,

AIR SDK 22 looks good, can you use it?

-Roshan

1 reply

Adobe Employee
June 5, 2016

Hi @Ylazy

Did you notice this difference in the latest Air Builds? How is the performance in earlier version of AIR Say SDK 18 and 19

-Roshan

YlazyAuthor
Known Participant
June 5, 2016

I've tested again with more AIR SDK:

Flash Player 18: 828 ms

AIR SDK 18: I cannot install AIR SDK 18 with Animate CC

Flash Player 19: 795 ms

AIR SDK 18: I cannot install AIR SDK 18 with Animate CC

Flash Player 20: 4171 ms

AIR SDK 20: 5365 ms

Flash Player 21: 796 ms

AIR SDK 21: 5684 ms

Flash Player 22: 854 ms

AIR SDK 22: 923 ms

Roshan ChhetriCorrect answer
Adobe Employee
June 5, 2016

Hi,

AIR SDK 22 looks good, can you use it?

-Roshan